import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts.js'

/**
 * 查找业务数据对应的班次
 * @param {String} businessTypeEnum 场景枚举
 */
export const findScheduleShiftTimeByKey = async(businessTypeEnum) => {
  const url = ApiModulesRoutes.BASE + '/scheduleShiftTime/findScheduleShiftTimeByKey'
  return await request.get(url, { params: { businessTypeEnum } })
}

/**
 * 添加单个班次
 * @param scheduleVo
 * @return {Promise<AxiosResponse<any>>}
 */
export const addScheduleShiftTime = async(scheduleVo) => {
  const url = ApiModulesRoutes.BASE + '/scheduleShiftTime/addScheduleShiftTime'
  return await request.post(url, scheduleVo)
}
/**
 * 修改业务数据班次信息
 * @param scheduleVo
 * @return {Promise<void>}
 */
export const apiUpdateScheduleShiftTime = async(scheduleVo) => {
  const url = ApiModulesRoutes.BASE + '/scheduleShiftTime/updateScheduleShiftTime'
  return await request.post(url, scheduleVo)
}

/**
 * 删除业务数据班次信息
 * @param scheduleVo
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiDelScheduleShiftTime = async(scheduleVo) => {
  const url = ApiModulesRoutes.BASE + '/scheduleShiftTime/delScheduleShiftTime'
  return await request.post(url, scheduleVo)
}

/**
 * 分页查询班次列表
 */
export const apiFindScheduleShiftTimeByParam = async(paramVo) => {
  const url = ApiModulesRoutes.BASE + '/scheduleShiftTime/findScheduleShiftTimeByParam'
  return await request.post(url, paramVo)
}
